home *** CD-ROM | disk | FTP | other *** search
/ Freelog 22 / freelog 22.iso / Prog / Djgpp / GPC2952B.ZIP / doc / gpc / docdemos / anddemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-02-09  |  230 b   |  12 lines

  1. program AndDemo;
  2. var
  3.   a, b, c: Integer;
  4. begin
  5.   if (a = 0) and (b = 0) then  { logical `and' }
  6.     c := 1
  7.   else if a and b = 0 then  { bitwise `and' }
  8.     c := 2
  9.   else
  10.     and (c, a)  { same as `c := c and a' }
  11. end.
  12.